package com.dasberg.gwt.dispatch;

import com.dasberg.gwt.command.Action;
import java.lang.reflect.ParameterizedType;

/**
 * Abstract class that takes care of getting the correct Action class.
 * @author mischa
 */
public abstract class AbstractHandler<Action> implements Handler<Action> {

    /**
     * Gets the parameterized Type
     * @return class The Action class.
     */
    public final Class<Action> getActionClass() {
        return (Class) ((ParameterizedType) this.getClass().getGenericSuperclass()).getActualTypeArguments()[0];
    }
}
